home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Samples / SampleCode / GeometryTest / untitled < prev   
Encoding:
Text File  |  1996-02-16  |  1.2 KB  |  43 lines  |  [TEXT/MPCC]

  1.     if(MetafileFileSpecify( &theFileSpec )) {
  2.     
  3.         SetCursor(*(GetCursor(watchCursor)));
  4.         
  5.         //    Initialize QuickDraw 3D, open a connection to the QuickDraw 3D library
  6.         myStatus = Q3Initialize();
  7.         if ( myStatus == kQ3Failure ) {
  8.             DebugStr("\pErInitialize returned failure.");    
  9.             ExitToShell() ;
  10.         }
  11.                         
  12.         // install the error handler - this gets called whenever
  13.         // an error occurs, which means we don't have to check so 
  14.         // much
  15.         Q3Error_Register( MyErrorHandler, 0L );        
  16.         Q3Warning_Register( MyWarningHandler, 0L );        
  17.     
  18.         // set up our globals
  19.         gQuitFlag = false ;
  20.         gMainWindow = NewCWindow(nil,&rBounds,title,false,noGrowDocProc,(WindowPtr)-1,true,nil); ;
  21.  
  22.         // initialise our document structure
  23.         InitDocumentData( &gDocument ) ;
  24.         
  25.         // try to read the file into the main display group
  26.         if((gDocument.fModel = MyNewModelFromFile(&theFileSpec)) != NULL ) {        
  27.  
  28.             AdjustCamera(    &gDocument,
  29.                             (gMainWindow->portRect.right - gMainWindow->portRect.left),
  30.                             (gMainWindow->portRect.bottom - gMainWindow->portRect.top) ) ;
  31.  
  32.             SetWTitle( gMainWindow, theFileSpec.name );
  33.             ShowWindow( gMainWindow ) ;
  34.             SetPort( gMainWindow ) ;
  35.     
  36.             SetCursor(&qd.arrow) ;
  37.             MainEventLoop();
  38.             
  39.         }
  40.     }
  41.             
  42.     DisposeDocumentData( &gDocument ) ;
  43.